package com.ddwanglife.jvm;

public class MyObject {
    public static void main(String[] args) {
        Object obj = new Object();
        System.out.println(obj.getClass().getClassLoader());// null bootstrap 由于是c++写的，所以是空
//        System.out.println(obj.getClass().getClassLoader().getParent());//Exception in thread "main" java.lang.NullPointerException

        MyObject mObj = new MyObject();
        System.out.println(mObj.getClass().getClassLoader());//sun.misc.Launcher$AppClassLoader@18b4aac2
        System.out.println(mObj.getClass().getClassLoader().getParent());//sun.misc.Launcher$ExtClassLoader@6d6f6e28
        System.out.println(mObj.getClass().getClassLoader().getParent().getParent());//null
    }
}
